﻿/*
* @autor: hectorea
* @date: 12/07/2012
* @programming interview 10
*/

namespace ConcatenateTwoNumbers
{
    public static class IntExtension
    {
        /// <summary>
        /// Concatenate two numbers
        /// </summary>
        /// <param name="a">Integer value</param>
        /// <param name="b">Integer value</param>
        /// <returns>The sum of the two numbers</returns>
        public static int Concatenate(this int number1, int number2)
        {
            int c = number2;
            while (c > 0)
            {
                number1 *= 10;
                c /= 10;
            }

            return number1 + number2;
        }
    }
}
